import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: "/",
            redirect: "/weather",
        },
        {
            path: "/weather",
            name: "weather",
            component: () => import("@/views/WeatherView.vue"),
        },
        {
            path: "/weather/:cityCode",
            name: "search",
            component: () => import("@/views/SearchView.vue"),
            props: true,
        },
    ],
});

export default router;
